package com.zw.mes.module.prdctionFlow.controller;

import com.zw.mes.base.BaseController;
import com.zw.mes.common.JsonResult;
import com.zw.mes.common.ValidResult;
import com.zw.mes.entity.sys.Dept;
import com.zw.mes.entity.sys.Dict;
import com.zw.mes.module.prdctionFlow.model.TransModel;
import com.zw.mes.module.prdctionFlow.service.TransQuerytService;
import com.zw.mes.module.system.service.DeptService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Description: 部门接口
 *
 * @Author: China.sgl
 * @Date: 2020/8/3 16:11
 */
@Controller
@RequestMapping("/flow/transquery")
@SuppressWarnings("all")
public class TransQueryController extends BaseController {

    @Autowired
    private TransQuerytService transQuerytService;

    @GetMapping
    @RequiresPermissions({"flow:transquery:view"})
    public String page(Model model) {
        return "flow/transquery/page";
    }

    /**
     * 系统字典数据
     */
    @ResponseBody
    @PostMapping("/list")
    @RequiresPermissions({"flow:transquery:view"})
    public JsonResult list(TransModel transModel) {
        startPage();
        List<TransModel> list = transQuerytService.findTransByCondition(transModel);
        return jsonResult(list);
    }

}
